<!--Simple test Template-->
{% extends "base.html" %}
{% block content %}
<script type="text/javascript" src="http://maps.googleapis.com/maps/api/js?key=AIzaSyCBdIbqSsMIDowQm3KzNIIu7ScV4IMFqu4&sensor=false"></script> 
<script>
var geocoder;
var map;
function initialize()
{
	geocoder = new google.maps.Geocoder();
	var latlng = new google.maps.LatLng(-34.397, 150.644);
	var myOptions = {
		zoom: 15,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	}
	map = new google.maps.Map(document.getElementById("gm"), myOptions);
}
$(document).ready(function ()
{
	initialize();
	var address = $('#street').val()+', '+$('#city').val()+', '+$('#country').val();
	geocoder.geocode( { 'address': address}, function(results, status) {
		if (status == google.maps.GeocoderStatus.OK)
		{
			map.setCenter(results[0].geometry.location);
			var marker = new google.maps.Marker({
				map: map,
				position: results[0].geometry.location
			});
		} 
		else
			alert("Geocode was not successful for the following reason: " + status);
	});
});
</script>
<div id="a">
  <header> <a href="/admin" title="Przejdź do strony głównej"><strong>OWMX</strong> LOGISTIC</a>
  </header>
  <div id="b">
   	<input type="hidden" id="name" name="name" value="Adres:" />
        <input type="hidden" id="city" name="city" value="{{address.city}}" />
        <input type="hidden" id="street" name="street" value="{{address.street}} {{address.street_no}}" />
        <input type="hidden" id="country" name="country" value="{{address.country}}" />
    	<article style="border:none; margin-left:20%">
    	<span class="error">{{ errors }}</span><p>Adres</p><p>{{address}}</p><br>      
	<div id="gm" style="width:400px; height:400px"></div>
    </article>
  </div>
  <footer>
    <p><!-- Template Design &amp; Markup by <a href="http://jabz.net/contact/jonas-jacek">Jonas Jacek</a> | <a href="http://owmx.com/" title="Free HTML5 &amp; CSS3 Web Templates">Free Web Templates</a>.--></p>
  </footer>
</div>


{% endblock %}
